from sklearn.feature_extraction.text import CountVectorizer

X = ['我 爱 你',
     '我 恨 你 恨 你',
     '任 然 不 行',
     'apple is fruit',
     'vehicle is matter']

count = CountVectorizer()
x = count.fit_transform(X)
print(x.A)
print(x.toarray())
print(count.get_feature_names())

from sklearn.feature_extraction.text import TfidfVectorizer
ti = TfidfVectorizer(norm=None,
                     )
x = ti.fit_transform(X)
print(ti.get_feature_names())
print(x.A)
